using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Client
{
    public partial class Loop : Form
    {
        public Loop()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int Num =0;
            int NumSucc = 0;
            int NumFault = 0;
            Message mess = new Message();
            mess.Header = "123456";
            mess.TypeIndentifier = "1234";
            mess.PrimaryBitMap = "1234567890123456";
            mess.ProcessingCode = "123456";
            mess.ResponseCode = "12";
            mess.UserID = txtUser.Text;//"use1811303240845";
            mess.OTPNumber = txtPassCode.Text;//"744637";
            try
            {
                Num = Int32.Parse(txtNumMessage.Text);
            }
            catch (Exception ee)
            {
                return;
            }
            
            for (int i = 0; i < Num; i++)
            {
                if (Login.login(mess))
                {
                    NumSucc += 1;
                }
                else
                {
                    NumFault += 1;
                }
            }

            MessageBox.Show("Successful: " + NumSucc + "   Fault: " + NumFault);
        }
    }
}